package com.bestway.controller;

import com.bestway.server.impl.CalSumImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class CalcSumController {
    @Autowired
    private CalSumImpl calSum;

    @PostMapping("/calSum")
    public Map<String,Object> getSum(boolean flag,float a,float b){
        Map<String,Object> map = new HashMap<>();
        float clac = calSum.getClac(flag, a,b);
        map.put("status",200);
        map.put("计算结果",clac);
        return map;
    }
}
